﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace craigsPack
{
    /// <summary>
    /// Represents the base class for all web providers search settings
    /// </summary>
    public class WebProviderSearchSettings
    {
        private readonly Dictionary<string, object> keyValues = null;

        protected WebProviderSearchSettings()
        {
            keyValues = new Dictionary<string, object>();
        }
        /// <summary>
        /// Adds a key and value to the collection
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        protected void Add(string key, object value)
        {
            keyValues.Add(key, value);
        }
        public bool Contains(string key)
        {
            return keyValues.Keys.Contains(key);
        }
        public object this[string key]
        {
            get 
            {
                if (!keyValues.Keys.Contains(key))
                    return null;
                return keyValues[key]; 
            }
            set { keyValues[key] = value; }
        }
    }
}
